package com.林子祺.CAT旅游系统.entity.ticketbuy;

import com.林子祺.CAT旅游系统.dao.placemanagement.PlacePull;
import com.林子祺.CAT旅游系统.util.BuyStructure;

import java.util.ArrayList;

public class BuyData {

    static ArrayList<BuyStructure> bs = new ArrayList<>();

    public static void InputData(int order_id, String costumer, int ticketBought, String buytime){
        bs.add(new BuyStructure(order_id,costumer,ticketBought,buytime));
    }

    public static boolean OutputData(int number){
        if(number < bs.size()) {
            BuyStructure p = bs.get(number);
            CurrentBuyData.order_id = p.getOrder_id();
            CurrentBuyData.costumer = p.getCostumer();
            CurrentBuyData.TicketBought = p.getTicketBought();
            CurrentBuyData.Buytime = p.getBuytime();
            return true;
        }
        else
            return false;
    }

    public static void Refresh(){

        bs.removeAll(bs);
        PlacePull.pull();

    }

}
